package com.laich.springcloud.fallback;

import org.springframework.stereotype.Component;

import com.laich.springcloud.fallback.impl.RemoteUserFeignImpl;
import com.laich.springcloud.feign.RemoteUserService;

import feign.hystrix.FallbackFactory;

/**
 * Feign+Hystrix使用FallbackFactory统一处理
 * @author laichunhua
 *
 */
@Component
public class RemoteUserServiceFallbackFactory implements FallbackFactory<RemoteUserService>{

	@Override
	public RemoteUserService create(Throwable throwable) {
		RemoteUserFeignImpl feign = new RemoteUserFeignImpl();
		return feign;

	}
	

}
